package com.pcbly.web.components.taglib.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;
import com.pcbly.web.components.taglib.Button;

public class ButtonTag extends ComponentTagSupport {
	
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3022253640735596992L;

	private String id;

	private String name;

	private String type;

	private String value;

	private String className;

	private String title;

	private String textAndIcon;

	private String onclick;

	private String onfocus;

	private String onblue;

	private String onmouseover;

	private String onmouseout;
	
	private String style;
	
	public ButtonTag() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public Component getBean(ValueStack stack, HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		return new Button(stack);
	}
	protected void populateParams() { 
		super.populateParams();  
		Button button = (Button)component; 
		
		button.setId(id);
		button.setClassName(className);
		button.setName(name);
		button.setTextAndIcon(textAndIcon);
		button.setTitle(title);
		button.setType(type);
		button.setValue(value);
		
		button.setOnblue(onblue);
		button.setOnclick(onclick);
		button.setOnfocus(onfocus);
		button.setOnmouseout(onmouseout);
		button.setOnmouseover(onmouseover);
		button.setStyle(style);
		
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTextAndIcon() {
		return textAndIcon;
	}

	public void setTextAndIcon(String textAndIcon) {
		this.textAndIcon = textAndIcon;
	}

	public String getOnclick() {
		return onclick;
	}

	public void setOnclick(String onclick) {
		this.onclick = onclick;
	}

	public String getOnfocus() {
		return onfocus;
	}

	public void setOnfocus(String onfocus) {
		this.onfocus = onfocus;
	}

	public String getOnblue() {
		return onblue;
	}

	public void setOnblue(String onblue) {
		this.onblue = onblue;
	}

	public String getOnmouseover() {
		return onmouseover;
	}

	public void setOnmouseover(String onmouseover) {
		this.onmouseover = onmouseover;
	}

	public String getOnmouseout() {
		return onmouseout;
	}

	public void setOnmouseout(String onmouseout) {
		this.onmouseout = onmouseout;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

}
